package org.spring.springboot.service.mall.impl;

import org.spring.springboot.dao.mall.ShopBaseInfoMapper;
import org.spring.springboot.domain.PageParamVo;
import org.spring.springboot.domain.mall.ShopBaseInfo;
import org.spring.springboot.service.mall.ShopBaseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class ShopBaseInfoServiceImpl implements ShopBaseInfoService {

    @Autowired
    private ShopBaseInfoMapper shopBaseInfoMapper;

    @Override
    public Integer insert(ShopBaseInfo shopBaseInfo) {
         return shopBaseInfoMapper.insert(shopBaseInfo);
    }

    @Override
    public Integer deleteByPrimaryKey(Integer id) {
        return shopBaseInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Map<String,Object> selectAll(PageParamVo vo) {
        List<Map<String,Object>>list = shopBaseInfoMapper.selectForPage(vo);
        Integer total = shopBaseInfoMapper.selectAll();
        Map<String ,Object> resMap = new HashMap<>();
        resMap.put("list",list);
        resMap.put("total",total);
        return resMap;
    }

    @Override public Integer updateByPrimaryKey(ShopBaseInfo shopBaseInfo) {
        return shopBaseInfoMapper.updateByPrimaryKey(shopBaseInfo);
    }



}
